package data.missions;

import data.tileables.Unit;

public class PowerUpUnit extends PowerUp{
	private Unit thisUnit;
	public PowerUpUnit(Unit u)
	{
		super();
		thisUnit = u;
	}
	public int execute()
	{
		if(thisUnit.getState() == 0)
		{
			if(ticksLeft > 0)
			{
				ticksLeft--;
				return 0;
			}
			else
			{
				thisUnit.setState(true);
				if(thisUnit.getOwner()!=null)
				{
					thisUnit.getOwner().addUnit(thisUnit);
				}
				return 1;
			}
		}
		return 1;
	}

}
